bindPhoneController = BaseController.extend({
	template:'bindPhone',
	center:'绑定手机',
	mainView: 'bindPhone',
	headerTransparent:false,
	waitOn:function(){
		//Meteor.subscribe('parters',{passwd: 123456});
	},
	onRendered:function(self){
		var myApp = new Framework7({
			modalTitle: "提示",
		});
		var $$ = Dom7;
		$$('.form-to-data').on('click', function(){
  			var formData = myApp.formToData('#bind-phone');
  			//需要验证输入密码是否正确
  			if (formData.phone.length !== 11)
  			{
  				console.log(formData.phone);
  				myApp.alert('手机号位数不正确，请重新输入');
  				$("#telephone").val('');
  			}else if (formData.checkNum !== '2222'){
  				myApp.alert('验证码输入不正确，请重新输入');
  				$("#check-num").val('');
  			}else {
  			//把新密码插入到parter表中
  				var parter = {
  					'name': 'kitty2',
  					'passwd': formData.newPasswd,
  					'phone': 12345678900,
  				};
  				Partners.insert(parter);
  				myApp.alert('手机绑定成功', function(){
					Router.go('setAccount');
				});
  			}

		});
		$('#getPhone').on('click', function(){
			myApp.alert('短信验证码发送成功');
		});
	},
	data:function(){
		return{
			//parter1:Parters.findOne(),
		}
	},
})
